package org.example;

import org.example.framework.MyApp;
import org.example.framework.MyException;

import java.lang.reflect.Method;
import java.util.Properties;

public class Application {
    public static void main(String[] args){
        try {
            //获取属性
            Properties prop= MyApp.LoadProperties("/myapp.properties");
            //获取类
            Class clazz= MyApp.getClass(prop);
            //获取标注注解的方法
            Method method=MyApp.getInitMethod(clazz);
            //创建类的对象
            Object obj= MyApp.creatObject(clazz);
            //调用注解方法
            MyApp.invokeMethod(obj,method);
        } catch (MyException e) {
            System.out.println(e.getErrorType()+":"+e.getMessage());
        }
    }
}
